CFLAGS=/nologo /W3 /GS- /GR- /Gy- /Oi- /O1 /c /Fobuild\ 
LDFLAGS=/nologo /nodefaultlib /incremental:no /safeseh:no /subsystem:console,5.01 /merge:.rdata=.text /EMITPOGOPHASEINFO /stub:build\t /align:16 kernel32.lib user32.lib Ws2_32.lib build\msvcrt.lib
LIBFLAGS=/nologo /machine:X86

all: bin\dns_client.exe

{build}.obj{bin}.exe:
    link $(LDFLAGS) /OUT:$@ $<

{src}.c{build}.obj:
    cl $(CFLAGS) $<

bin\dns_client.exe:build\dns_client.obj build\msvcrt.lib build\t

build\msvcrt.lib: defs\msvcrt.def
    lib $(LIBFLAGS) /out:$@ /def:defs\msvcrt.def

build\t:
    @echo MZ............................................................> build\t

.PHONY: all clean

clean:
    @del /s /q build\*

dist-clean:
    @del /s /q build\* bin\*